﻿@using lindyaka.Models.Administration
@model IEnumerable<lindyaka.Models.Administration.Role>

@{
    ViewBag.Title = "Roles";
    Layout = "~/Areas/Administration/Views/Shared/_Layout.cshtml";
}

<div>
    <h2>@ViewBag.Title</h2>

    <p>
        @Html.ActionLink("Create New", "Create")
    </p>

    <div class="table-responsive">
        <table class="table">
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.Name)
                </th>
                <th></th>
            </tr>

            @foreach (Role item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Name)
                    </td>
                    <td>
                        @Html.ActionLink("Edit", "Edit", new {id = item.RoleId}) |
                        @Html.ActionLink("Details", "Details", new {id = item.RoleId}) |
                        @Html.ActionLink("Delete", "Delete", new {id = item.RoleId})
                    </td>
                </tr>
            }

        </table>
    </div>
    
    <div>
        @Html.ActionLink("Administration Panel", string.Empty, "Panel", new {Area = "Administration"}, new {})
    </div>

</div>